/**
 * Created by dale on 2017/8/22.
 */
$(document).ready(function () {


    var form = new xhForm($('#xh_form'));
    form.parse();
    $(".form-date").datetimepicker({format: 'yyyy-mm-dd',language: 'zh-CN',minView: "month", autoclose:true});


    $("#cc2").combotree({
        url:modelUrl+'template/getDepStaff/0',
        required:false,
        cascadeCheck:false,
        onBeforeSelect: function (node) {
            if (!$("#cc2").combotree("tree").tree('isLeaf', node.target)) {
                $('#cc2').combotree("clear");
                return false;
            }
        }
    });

    $('#cc2').combotree('setValue',iChargeId);

    $('#bt_modal_confirm',parent.document).click(function () {
        form.submit('bpm/plan/saveAlterHeadCharger',{},function (res) {
            window.top.xhTop.showSuccess(res.msg);
            window.top.xhTop.getActiveFrame().planList.treegrid('reload');
            window.top.xhTop.closeModal();
        });
    });
    // modalBind.bindClick();
});